//
//  AWSettingUnitButton.m
//  AmberWeather
//
//  Created by LeeSongtao on 16/3/14.
//  Copyright © 2016年 Amber Weather. All rights reserved.
//

#import "SmapuxSettingUnitButton.h"

@interface SmapuxSettingUnitButton ()

@end

@implementation SmapuxSettingUnitButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        self.titleLabel.font = THFont(12);
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self setTitleColor:THWhiteAlplaColor(0.64) forState:UIControlStateNormal];
        self.changedUnitState = NO;
    }
    return self;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.width;
    CGFloat h = contentRect.size.height * 0.3;
//    CGFloat y = self.height - h - 2;
    CGFloat y = self.height * 0.65;

    return CGRectMake(0, y, w, h);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat w = contentRect.size.width * 0.6;
    CGFloat h = contentRect.size.height * 0.6;
//    CGFloat w = Sampux6HScale(20);
//    CGFloat h = Sampux6HScale(20);
    CGFloat x = (self.width - w) / 2;
    return CGRectMake(x, 0, w, h);
}

@end
